package com.storlead.shiro.controller;

import com.storlead.shiro.util.Result;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Timo
 * @Date: 2019/2/14 17:21
 * @Description: 类用途：
 */
@Controller
@RequestMapping
public class IndexController {

    @GetMapping("/index")
    public String index(Model model){
        model.addAttribute("user","timo");
        return "index";
    }

    @GetMapping("/to_login")
    public String toLogin(Model model){
        Result result = new Result(1,"");
        model.addAttribute("result",result);
        return "login";
    }

    @GetMapping("/403")
    public String error_403(){
        return "403";
    }




}
